{template 'public/header'}
{template 'public/comhead'}
<link rel="stylesheet" type="text/css" href="../addons/zh_cjdianc/template/public/ygcsslist.css">
<style type="text/css">
    .download{
        float: right;
        line-height: 30px;
        color: #44ABF7;
    }
    .download i{margin:0 10px;}
    .first{
        width: 100px;
        position: relative;
    }
    .use_img{
        position: absolute;
        top:20px;
        left:10px;
        width: 80px;
        height: 80px;
        background: #ccc;
        border-radius: 100%;
        vertical-align: top;
    }
    .user_name i{
        color: #fcd700;
        margin-left: 10px;
    }
    .comment_con td{
        font-size: 14px;
    }
    .border{
        border-bottom: 1px solid #cdcdcd;
        padding: 20px 0
    }
    .star i{
        color:#fa952f;
        margin:5px 0;
        font-size: 16px;
    }
    .star i.gray{
        color: #e9e9e9;
    }
    .use_comment{
        margin:10px 0;
    }
    .other{
        margin-bottom: 10px;
    }
    .other img{
        width: 80px;
        height: 80px;
        margin-right: 10px;
    }
    .other img.on{
        width: 300px;
        height: auto;
    }
    .record{
        color: #888;
    }
    .record p{
        margin:0;
    }
    .bottom{
        text-align: right;
    }
    .time{
        color: #888;
        padding-right: 10px;
    }
    .shop_ca{
        padding-right: 10px;
        margin-top: 50px;
    }
    .shop_ca a{
        color: #44ABF7;
        margin-left: 20px;
    }
    .shop_ca a i{
        margin-right: 5px;
    }
    .yg5_tr2{
        height: 45px;
        text-align: center;;
        color: #888;
    }
    .textarea{
        width: 100%;
        border:1px solid #cdcdcd;
        padding: 10px;
        resize: none;
        font-size: 15px;
    }
    .tip{
        display: none;
        position: fixed;
        background: rgba(0,0,0,0.5);
        width: 100%;
        height: 100%;
        top: 1px;
        left: 1px; 
    }
    .tip span{
        float: right;
        color: #fff;
        font-size: 45px;
        margin: 25px;
        line-height: 130px;
    }
    .tip img{
        width: 400px;
        height: auto;
        display: relative;
        position: absolute;
        top: 150px;
        left: 50%;
        margin-left: -200px;
    }
</style>
<ul class="nav nav-tabs">
    <span class="ygxian"></span>
    <div class="ygdangq">当前位置:</div>
    <li {if $_GPC['type']==1} class="active" {/if}><a href="{php echo $this->createWebUrl('assess',array('type'=>1));}">全部({php echo count($qb)})</a></li>
    <li {if $_GPC['type']==2} class="active"{/if}><a href="{php echo $this->createWebUrl('assess',array('type'=>2));}">未回复({php echo count($whf)})</a></li>
<!--     <p class="download">下载评价列表<i class="fa fa-download" aria-hidden="true"></i></p>
 -->
 </ul>
<div class="main">
    <div class="panel">
        <div class="panel-body">
            <div class="row">
                <table class="col-md-12 comment_con">
                {loop $list  $row}
                    <tr class="">
                        <td class="first"><img src="{$row['user_img']}" alt="" class="use_img"></td>                        
                        <td class="col-md-9 border">
                            <div class="user_name">{$row['name']}  ({$row['store_name']})</div>
                            {if $row['stars']==5}
                            <div class="star">
                                <i class="fa fa-star"></i>
                                <i class="fa fa-star"></i>
                                <i class="fa fa-star"></i>
                                <i class="fa fa-star"></i>
                                <i class="fa fa-star"></i>
                            </div>
                            {/if}
                            {if $row['stars']==4}
                            <div class="star">
                                <i class="fa fa-star"></i>
                                <i class="fa fa-star"></i>
                                <i class="fa fa-star"></i>
                                <i class="fa fa-star"></i>
                                <i class="fa fa-star gray"></i>
                            </div>
                            {/if}
                            {if $row['stars']==3}
                            <div class="star">
                                <i class="fa fa-star"></i>
                                <i class="fa fa-star"></i>
                                <i class="fa fa-star"></i>
                                <i class="fa fa-star gray"></i>
                                <i class="fa fa-star gray"></i>
                            </div>
                            {/if}
                            {if $row['stars']==2}
                            <div class="star">
                                <i class="fa fa-star"></i>
                                <i class="fa fa-star"></i>
                                <i class="fa fa-star gray"></i>
                                <i class="fa fa-star gray"></i>
                                <i class="fa fa-star gray"></i>
                            </div>
                            {/if}
                            {if $row['stars']==1}
                            <div class="star">
                                <i class="fa fa-star"></i>
                                <i class="fa fa-star gray"></i>
                                <i class="fa fa-star gray"></i>
                                <i class="fa fa-star gray"></i>
                                <i class="fa fa-star gray"></i>
                            </div>
                            {/if}

                            
                            <p class="use_comment">{$row['content']}</p>
                            <div class="other">
                            {loop $row['img'] $key $row2}
                                <img src="{media $row2}" alt="">
                        {/loop}
                            </div>
                            {if $row['state']==2}
                            <div class="record">
                                <p>商家回复:  {$row['hf']}</p>
                                <p>回复时间:  {$row['hf_time']}</p>
                            </div>
                            {/if}
                        </td>
                        <td class="bottom border">
                            <div class="time">评价时间 {$row['time']}</div>
                            <div class="shop_ca">
                                <a href="javascript:;" data-toggle="modal" data-target="#myModalb{$row['id']}">删除</a>
                                <a href="javascript:void(0);" data-toggle="modal" data-target="#myModal{$row['id']}">
                               <span class="recive"><i class="fa fa-envelope-o"></i>回复</span>
                                </a>
                            </div>
                        </td>                        
                        <div class="modal fade" id="myModal{$row['id']}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
                            <div class="modal-dialog" role="document">
                                <div class="modal-content">
                                  <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                                    <h4 class="modal-title" id="myModalLabel" style="font-size: 20px;">提示</h4>
                                </div>
                                <form action="" method="post">
                                    <div class="modal-body" style="font-size: 20px">
                                        <textarea name="con" id="" rows="5" class="textarea"  placeholder="请输入你想说的话!"></textarea>
                                    </div>
                                    <div class="modal-footer">
                                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                                        <input type="submit" name="submit" value="发送" style="background: #44ABF7;color: #fff" class="btn">
                                         <input type="hidden" name="token" value="{$_W['token']}"/>
                                            <input type="hidden" name="id" value="{$row['id']}"/>
                
                                    </div>
                                </form>
                            </div>
                        </div>
                        </div>
                            <div class="modal fade" id="myModalb{$row['id']}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
                      <div class="modal-dialog" role="document">
                        <div class="modal-content">
                          <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                            <h4 class="modal-title" id="myModalLabel" style="font-size: 20px;">提示</h4>
                        </div>
                        <div class="modal-body" style="font-size: 20px">
                            确定删除么？
                        </div>
                        <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                            <a href="{php echo $this->createWebUrl('assess', array('op' => 'delete', 'id' => $row['id']))}" type="button" class="btn btn-info" >确定</a>
                        </div>
                    </div>
                </div>
            </div>
                    </tr>
                    {/loop}







                    {if !$list}
                    <tr class="yg5_tr2">
                        <td colspan="3">
                          没有更多评论啦
                      </td>
                    </tr> 
                    {/if}
                </table>  

             <!--图片放大-->
                <div class="tip col-md-11">
                    <span class="error">×</span>
                    <img src="" alt="" class="big">
                </div>                
            </div>
        </div>
    </div>
</div>
<div class="text-right we7-margin-top">
     {$pager}
</div>
<script type="text/javascript">
    $(function(){
        $("#frame-7").show();
        $("#yframe-7").addClass("wyactive");
        // $("#frame-2").addClass("in");
        // 
        //点击图片放大
        $(".other img").click(function(){
            var src=$(this).attr("src")
            console.log(src)
            console.log($(this).index())
            $(".tip").show()
            $(".tip img").attr("src",src)
        })
        $(".tip").click(function(){
            $(this).hide()
        })
    })
</script>